<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	/**
	* 
	*/
	class ADMIN extends CI_Controller
	{
		
		public function __construct()
		{
			parent::__construct();
			$this->checkLoginWithCookie();
			$this->load->helper('url');
			$this->load->library('session');
		}


		private function checkLoginWithCookie(){
			$this->load->helper('url');
			$this->load->library('session');
			$userData = $this->session->userdata('userData');
			$userData = $this->session->userdata('userData');
			$username = $userData['username'];
			$password = $userData['password'];
			$this->load->model('user_admin_model');
			$user_index = $this->user_admin_model->selectCode(array('login_name' => $username , 'password' => $password),'index');
			if($user_index){
				
				// $url = 'http://localhost/cal/admin/user_admin/highest_admin';
				// echo "<script>window.location.href='".$url."';</script>";
				 return true;

			}else{

				 return false;
			}
		}
	}
?>